<template>
  <div class="asset-srceen">
    <Page-title title="资产管理数据驾驶舱" />
    <div class="srceen-content">
      <div class="srceen-content-left">
        <Pandect :dept-list="deptList" @total="getTotal" />
        <Scrap />
        <Increase />
      </div>
      <div class="srceen-content-center">
        <Property :total="totalNum" />
        <Consumables />
        <Device />
      </div>
      <div class="srceen-content-right">
        <Asset-manage :dept-list="deptList" />
        <Allocate :dept-list="deptList" />
        <Receive />
      </div>
    </div>
  </div>
</template>

<script>
import Pandect from "./components/Pandect";
import Scrap from "./components/Scrap";
import Increase from "./components/Increase";
import Property from "./components/Property";
import Consumables from "./components/Consumables";
import Device from "./components/Device";
import AssetManage from "./components/AssetManage";
import Allocate from "./components/Allocate";
import Receive from "./components/Receive";
import { getDepartmentList } from "@/utils/srceen";
export default {
  name: "asset-srceen",
  components: {
    Pandect,
    Scrap,
    Increase,
    Property,
    Consumables,
    Device,
    AssetManage,
    Allocate,
    Receive,
  },
  data() {
    return {
      deptList: [], // 科室列表
      totalNum: 0, // 总资产数
    };
  },
  mounted() {
    this.getDeptList();
  },
  methods: {
    // 获取科室列表
    getDeptList() {
      getDepartmentList().then((res) => {
        if (res && res.code === 1) {
          this.deptList = [{ name: "全院", id: "" }].concat(res.data || []);
        }
      });
    },
    // 获取总资产数
    getTotal(v) {
      this.totalNum = v;
    },
  },
};
</script>
<style lang="scss" scoped>
.asset-srceen {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  background: url("~@/assets/srceen-bg.png") no-repeat;
  background-size: 100% 100%;
  .srceen-content {
    margin-top: 74px;
    flex: 1;
    display: flex;
    justify-content: center;
    &-left {
      width: 503px;
      height: 100%;
    }
    &-center {
      width: 863px;
      height: 100%;
      display: flex;
      flex-direction: column;
      margin: 0 17px;
    }
    &-right {
      width: 503px;
      height: 100%;
      display: flex;
      flex-direction: column;
    }
  }
}
</style>
